home *** CD-ROM | disk | FTP | other *** search
/ Champak 48 / cdrom_image.iso / Games / rollerrush / game.dcr / Internal_77_enter name pop close.ls < prev    next >
Encoding:
Text File  |  2007-10-01  |  1.2 KB  |  62 lines

  1. property sd, spriteNum
  2.  
  3. on beginSprite me
  4.   sd = sprite(spriteNum)
  5.   sd.blend = 0
  6. end
  7.  
  8. on mouseEnter me
  9.   sd.blend = 100
  10. end
  11.  
  12. on mouseLeave me
  13.   sd.blend = 0
  14. end
  15.  
  16. on mouseUp me
  17.   global gName
  18.   thename = sendSprite(348, #GetText)
  19.   playSound(9, "mousedown1")
  20.   if FreeName(me, thename) then
  21.     sendSprite(346, #closeUp)
  22.     sprite(349).visible = 0
  23.     if thename = EMPTY then
  24.       thename = "player"
  25.     end if
  26.     gName = thename
  27.     setPref("LastProfile", gName)
  28.     NewProfile(gName)
  29.     if gName = "SHAZaaM" then
  30.       CompleteProfile()
  31.     end if
  32.   else
  33.     sendSprite(372, #show)
  34.   end if
  35. end
  36.  
  37. on FreeName me, nam
  38.   global gProfiles
  39.   nottaken = 1
  40.   upName = makeUpperCase(me, nam)
  41.   put "upName", upName, nam
  42.   c = gProfiles.count
  43.   repeat with b = 1 to c
  44.     up = makeUpperCase(me, gProfiles[b])
  45.     put "comparing to", up
  46.     if up = upName then
  47.       nottaken = 0
  48.     end if
  49.   end repeat
  50.   return nottaken
  51. end
  52.  
  53. on makeUpperCase me, upString
  54.   repeat with x = 1 to length(upString)
  55.     thisChar = charToNum(char x of upString)
  56.     if (thisChar >= 97) and (thisChar <= 122) then
  57.       put numToChar(thisChar - 32) into char x of upString
  58.     end if
  59.   end repeat
  60.   return upString
  61. end
  62.